package cn.com.chengmandian.service.erp.constants;

/**
 * Description: cmd-erp-center
 * <p>
 * Created by asus on 2022/3/9 14:48
 */
public enum FileTypeEnum {

    FILE("file","文件"),
    FOLDER("folder","文件夹");

    private String code;

    private String name;

    public String getCode() {
        return this.code;
    }

    public String getName() {
        return this.name;
    }

    public static FileTypeEnum getNameByCode(String code){
        if(code == null){
            return null;
        }else{
            FileTypeEnum[] values = values();
            for(FileTypeEnum fileTypeEnum :values){
                if(fileTypeEnum.getCode().equals(code)){
                    return fileTypeEnum;
                }
            }
        }
        return null;
    }

    FileTypeEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }
}
